#include <iostream>

using namespace std;

class Tools {
public:
    virtual ~Tools() = default;

protected:
    virtual void compute() = 0;

    virtual void save() = 0;

public:
    virtual void doSomeThing() {
        compute();
        save();
    }
};

class ATools : public Tools {
public:
    ~ATools() override = default;

protected:
    void compute() override {
        cout << "Tools A Compute Data!" << endl;
    }

    void save() override {
        cout << "Tools A Save Data!" << endl;
    }
};

class BTools : public Tools {
public:
    ~BTools() override = default;

protected:
    void compute() override {
        cout << "Tools B Compute Data!" << endl;
    }

    void save() override {
        cout << "Tools B Save Data!" << endl;
    }
};

void test01() {
    Tools *tools = nullptr;

    tools = new ATools();
    tools->doSomeThing();
    delete tools;

    cout << endl;

    tools = new BTools();
    tools->doSomeThing();
    delete tools;
}


int main() {
    test01();
}
